<!DOCTYPE html>
<html>
<head>
    <title>编辑类别</title>
    <meta charset="UTF-8">
    <style>
        body {
            background-color: #f5f5f5;
            font-family: Arial, sans-serif;
        }

        .container {
            max-width: 500px;
            margin: 0 auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        h1 {
            font-size: 24px;
            margin-bottom: 20px;
            text-align: center;
            color: #333;
        }

        .message {
            background-color: #dff0d8;
            border: 1px solid #d6e9c6;
            color: #3c763d;
            margin-bottom: 10px;
            padding: 10px;
        }

        label {
            display: block;
            margin-bottom: 10px;
            color: #333;
        }

        input[type="text"],
        select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 3px;
            margin-bottom: 10px;
            box-sizing: border-box;
        }

        button {
            padding: 10px 20px;
            background-color: #337ab7;
            color: #fff;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            width: 100%;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>编辑类别</h1>
    {% with messages = get_flashed_messages() %}
    {% if messages %}
    <ul class="messages">
        {% for message in messages %}
        <li class="message">{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    {% endwith %}
    <form id="category-form" action="/class_edit_update" method="POST">
        <label for="class_id">类别ID：</label>
        <input type="text" id="class_id" name="class_id" value="{{ class_info[0][0] }}" readonly>

        <label for="class_name">类别名称：</label>
        <input type="text" id="class_name" name="class_name" value="{{ class_info[0][1] }}">

        <label for="class_code">类别编号：</label>
        <input type="text" id="class_code" name="class_code" value="{{ class_info[0][2] }}">

        <label for="parent_directory">上一级目录：</label>
        <select id="parent_directory" name="parent_directory">
            <option value="{{ class_info[0][3] }}">现有默认值</option>
            {% for class_list in class_list %}
            <option value="{{class_list[0]}}">{{class_list[1]}}</option>
            {% endfor %}
        </select>
        <button type="submit">提交</button>
    </form>
</div>
</body>
</html>
